<!--
/**************************************************
* @(#)bargainorganization.jsp
*
* Copyright (c) 2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/2/14, owen xia
*  1) first release
   2) add javascript method changelist2,implemnt select jump
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8"%>

<%@ include file="../common.jsp"%>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<SCRIPT language="JavaScript" src="<%=root%>/js/hi-check.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
<%session.removeAttribute("GSOrganizationScanQueryForm"); %>
<html>
<head>
<title>组织机构管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK rel="stylesheet" href="css/caigouxitong.css">
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
</head>
<%
String tReQuery = (String)request.getAttribute("requery");
%>

<script language="JavaScript">

function process(val){
      var iFields1 = new Array(2);
      
      iFields1[0] = 'gsorgid||机构编码||N||1-4||#0';
      iFields1[1] = 'gsorgname||机构名称||N||1-50||##';
     
      if( HiScript.value(checkform.name,iFields1) == false)  return false;
      
      if(val == 'Q' || val == 'Qre'){
				  if (val == 'Qre') {
					<%
					    if(tReQuery!=null && tReQuery.equals("true")){
					%>
					    checkform.action='<%= response.encodeURL(request.getContextPath() + "/A170106.do") %>';
                        checkform.submit();
                        return true;
			    	<%}%>
		    	} else if (val == 'Q') {
						checkform.action='<%= response.encodeURL(request.getContextPath() + "/A170106.do") %>';
                        checkform.submit();
                        return true;
		    	}
    	
		}
     
 }

function clean(){
      checkform.gsorgid.value ="";
	  checkform.gsorgname.value="";		
	  
    }

//为系统维护和管理-产品管理 提供回写方法
	function backtoManufacturemanagepage(radiobutton){
		//alert('hello');
		//alert(radiobutton.value);
		
		var OrganizationName;
	    if(document.pager.organizationname != null){
	    	for(i=0; i<document.pager.organizationname.length;i++){
					if(document.pager.organizationname[i].checked){
						OrganizationName=document.pager.organizationname[i].value;
							}
				         }
				    }
				  if(document.pager.organizationname.checked==true){
						OrganizationName=document.pager.organizationname.value;
					}
				  //alert(orderId); 
				  if(OrganizationName==null){
				   alert("请选择一个采购用户。");
				   return false;
				  }   
		var temp = tokenize(OrganizationName,'|','|');
		opener.document.getElementById('type').value=temp[2];
		opener.document.getElementById('provider_name').value = temp[1];
		opener.document.getElementById('provider_id').value = temp[0];
	
		window.close();
	}
	function wclose(){
	    window.close();
	}
</script>

<%
	ResultProcess tOrgList = (ResultProcess)request.getAttribute("orgList");
	ArrayList tList = new ArrayList();
%>
<body   BGCOLOR=#f2f2f2 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onload="process('Qre')">
<p><br></p>



<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">组织机构管理</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>

<!-- form start -->
<form name="checkform" method="get" onsubmit="if(!process()) return false;">
<font id="err_font" name="err_font" color="#000000"><input type="hidden" name="hidden" value=""></font>
<table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
  <td valign="top" class="title">
 	
	  <table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
		<tr> 
		  <td class="bg_column"><font id="bank_id_font" color="#000000">机构编号&nbsp;</FONT></td>
		  <td align=left class="bg_row_odd">
		  	  <input type="text" name="gsorgid" value="<%=request.getParameter("gsorgid")==null? "":request.getParameter("gsorgid") %>" maxLength=4 size="24"></input>
		  </td>
		  <td class="bg_column" align=center><font id="mer_id_font" color="#000000">机构名称&nbsp;</font></td>
		  <td align=left class="bg_row_odd">
             <input type="text" name="gsorgname" value="<%=request.getParameter("gsorgname")==null? "":request.getParameter("gsorgname")%>" maxLength=24 size="24"></input>
		  </td>
		  
		</tr>
		
	  </table>
	</td>
  </tr>
</table>
<%
if(tOrgList != null){
    int totalRecords = 0;
    int defaultPageSize = 10;
    totalRecords = tOrgList.getRecordsSize();
%>            
<page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'>
<%tList = tOrgList.getDisplayRecords(index.intValue(),pageSize.intValue()); %>
</page:pager>
<%} %>
</form>
<p align="center">  
		<input type="button" class="kuang" value='查询' onclick="process('Q')"/>&nbsp;
    	<input type="button" class="kuang" value='清空' onclick="clean()"/>&nbsp;				
	
    </p>
<!-- form end -->
<center>
<!--
****************************显示列表*********************************************
-->

<%
	
	if(tOrgList != null){
%>
 <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
            <td> 
                <form name='pager' method="post">
			    <input type=hidden name="orgid" >
			    <input type=hidden name="organizationname" >
			    
                <table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=98% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                        <td class=top align=middle> 
                            
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">机构编号</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">机构名称</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">机构地址</div>
                        </td>
                        <td class=top align=middle> 
                           <div align="center" class="txt_content">机构邮编</div>
                        </td>
                        <td class=top align=middle> 
                           <div align="center" class="txt_content">机构电话</div>
                        </td>
						 <td class=top align=middle> 
                            <div align="center" class="txt_content">机构传真</div>
                        </td>
                         <td class=top align=middle> 
                            <div align="center" class="txt_content">负责人姓名</div>
                        </td>
                         <td class=top align=middle> 
                            <div align="center" class="txt_content">负责人电话</div>
                        </td>
                         <td class=top align=middle> 
                            <div align="center" class="txt_content">负责人电子邮件</div>
                        </td>
                         <td class=top align=middle> 
                            <div align="center" class="txt_content">上级组织机构编号</div>
                        </td>
                    </tr>
                   <%
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							String[] tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
                    <tr <%=tTempStr%> height=20>
                       
                        <td class=top align=middle> 
                             <div align="center" class="txt_content">
								<input type="radio" name="organizationname" value="<%=tStr[1]+"|"+tStr[1]%>|2">
							 </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[0]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[1]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[2]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[3]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[4]%>
                            </div>
                        </td>
						<td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[5]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[6]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[8]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[7]%>
                            </div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content">
                            <%=tStr[9]%>
                            </div>
                        </td>
                    </tr>
                  			
					<%	
							}
					%>
                     <tr class="bg_column" height=20>
					    <td width="960" height="16" colspan="12" align="right">
								<!--导航条-->
								<page:navigator type='text' queryForm="checkform"/>
					    </td>
					  </tr>	
					  <%
						}else{
					%>
							<font color="red">没有符合条件的组织机构</font>
					<%
						}
					%>
                    </tbody> 
                </table>
               </form>	
            </td>
        </tr>
        <tr height="20">
		<td width="960" height="16" colspan="10" align="center" bgcolor="#f2f2f2">
		  <INPUT type="button" value="确定" class="kuang" onclick="return backtoManufacturemanagepage();">
		  &nbsp;<INPUT type="button" value="关闭" class="kuang" onclick="return wclose();">
	    </td>
	   </tr>
    </table>
 
 
   <!--
****************************显示列表*********************************************
   -->
   
</center>

<form action="" name="delform" method="post">	
      <input type=hidden name=orgid>		
    </form>

<%} %>
                           
</body>
</html>
